package org.jimmy.tang.reflect;

/**
 * @author jimmy
 * 
 */
public class Demo {

    public static void main(String[] args) throws Exception {
        Class<?> c = Class.forName("org.jimmy.tang.reflect.Student");
        Class<?>[] cs = new Class[] { int.class, String.class };
        Object[] objs = new Object[] { 20, "chb" };
        ReflectionAPIs api = new ReflectionAPIs();

        api.singleMethodAPI(c, "hi", cs, objs);
        api.staticMethodInvoke(c, "hi", cs, objs);

        // Exception if private field
        api.setPublicFiled(c, "age", 10);

        api.setPrivateField(c, "name", "Jimmy");

        api.setAndGetMethod(c, "setAge", "getAge", 20, int.class);

        api.packageInfoAPI(c);

        api.fieldInfoAPI(c);

        api.constructorInfoAPI(c);

        api.methodsInfoAPI(c);

        api.modifierInfoAPI(c);

        System.out.println(java.util.UUID.randomUUID().toString());

    }

}
